Recovering oil from wells is sometimes difficult, when oil is trapped in a heterogeneous porous medium. In order to enhance the ability of systems to recover oil from porous mediums, various schemes of water and/or gas injection have been used to push oil from the pores in such porous media. Basic injection of gas and/or water may not be efficient in various circumstances, since the porosity of the medium, the wettability of the medium, and the viscosity of the oil contained therein may vary. Therefore, schemes that may provide for greater efficiency in such processes may be desirable.